import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useMarkdownStore = defineStore(
  'markdown',
  () => {
    const md = ref('')
    const cover = ref('')

    const getMD = () => md.value
    const setMD = (article: string) => {
      md.value = article
    }

    const getCover = () => cover.value
    const setCover = (coverImg: string) => {
      cover.value = coverImg
    }

    return { md, cover, setMD, getMD, setCover, getCover }
  },
  {
    persist: true,
  },
)
